#include "peditor_cclayercolor.h"

#include "QtGui"
#include "CCQTControllerManager.h"

PEditor_CCLayerColor::PEditor_CCLayerColor(QWidget *parent) :
    AbstractPEditor(parent),
    ui(new Ui::PEditor_CCLayerColor)
{

	init();
    ui->setupUi(this);
//    QPalette * qp = new QPalette();
    m_colorPickerbtn = qFindChild<QPushButton *>(this , "colorPickerbtn");

}

PEditor_CCLayerColor::~PEditor_CCLayerColor()
{
    delete ui;
}

void PEditor_CCLayerColor::on_colorPickerbtn_clicked()
{
    QColor color = QColorDialog::getColor();
    int red = color.red();
    int green = color.green();
    int blue = color.blue();
    
    QString string = QString("color:red;background-color:rgb(%1,%2,%3)").arg(red).arg(green).arg(blue);
    m_colorPickerbtn->setStyleSheet(string);
}

QString PEditor_CCLayerColor::regName()
{
	return "CCLayerColor";
}



void PEditor_CCLayerColor::checkNode( const QCocoNode &node )
{

}

